package com.hyd.project;

import com.hyd.service.MusicService;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

public class StartActivity extends Activity {
	private Handler handler;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_start);

		init();
	}

	private void init() {
		handler = new Handler() {
			

			@Override
			public void handleMessage(Message msg) {
				super.handleMessage(msg);
				if (msg.what == 1) {
					Intent intent = new Intent(StartActivity.this,
							MainActivity.class);
					startActivity(intent);
					finish();
				}

			}

		};

		new Thread() {
			@Override
			public void run() {
				Intent intent = new Intent("BootBroadcastReceiver");
				sendBroadcast(intent);
			}
		}.start();
		handler.sendEmptyMessage(1);
	}
}
